//
//  NSMutableData+BufferHandler.h
//  LazyHome
//
//  Created by yh on 2018/4/17.
//  Copyright © 2018年 yh. All rights reserved.
//

#import <Foundation/Foundation.h>



@interface NSData(BufferHandler)
- (char)toChar;
- (unsigned char)toUChar;

- (short)toShort;
- (unsigned short)toUShort;

- (int)toInt;
- (unsigned int)toUInt;

+ (NSData *)dataWithUchar:(unsigned char)dat;

+ (NSData *)dataWithUshort:(unsigned short)dat;

@end

@interface NSMutableData(BufferHandler)
@property(nonatomic, strong)NSNumber * handle_index;
- (NSData *)readDataWithLength:(int)length;

- (void)resetHandleIndex2Zero;



@end
